<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var name="window";
        var obj={
            name:"obj",
            sayName:function(){
                console.log(this.name)
            }
        }
        function go(){
            console.log(this.name)
        }
        go();
        /* call/apply也可以改变函数内部this关键字的指向 */
        go.call(obj);
        go.apply(obj);
        /* 
        bind,call,apply区别：
        1.call，apply时调用时执行
        2.bind仅改变函数上下文的运行环境，不会马上执行
        */
    </script>
</body>
</html>